package lanqiao.api;

import java.math.BigInteger;
import java.util.Scanner;

/**
 * Character 常用 api
 */
public class CharacterDemo {
    public static void main(String[] args) {
        //判断是否是大写、小写字母
        System.out.println(Character.isUpperCase("A".charAt(0)));
        System.out.println(Character.isUpperCase("a".charAt(0)));
        System.out.println(Character.isLowerCase("a".charAt(0)));
        System.out.println("==========================================");

        String s = "asdji123";

        for (int i = 0; i < s.toCharArray().length; i++) {
            //检查字符串中的单个字符是否是字母
            boolean is = checkLetter(s.charAt(i));
            System.out.print(is + " ");
        }

    }

    private static boolean checkLetter(char ch) {
        return ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z';
    }
}
